package com.jr.service.impl;


import com.jr.entity.UserJobEnterprise;
import com.jr.mapper.UserJobEnterpriseDao;
import com.jr.service.UserJobEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;


/**
 * 用户工作企业三表关联
 *
 * @author Snoopy
 * @since 1.0.0 2022-12-31
 */
@Service
public class UserJobEnterpriseServiceImpl implements UserJobEnterpriseService {

    @Autowired
    UserJobEnterpriseDao userJobEnterpriseDao;

    @Override
    public List<UserJobEnterprise> queryJobAllByUid(Map<String,String> map) {
        return userJobEnterpriseDao.selectJobAllByUid(map);
    }

    @Override
    public int queryCoountPageById(Map<String, String> map) {
        return userJobEnterpriseDao.selectCoountPageById(map);
    }

    /**
     * @description: 查询三联表中是否有用户对应的工作
     * @author: 金宏飞
     * @date: 2023/1/9 21:53
     * @param: [userJobEnterprise]
     * @return: boolean
     **/
    @Override
    public boolean selectUIdEidJid(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.selectUIdEidJid(userJobEnterprise) != null;
    }

    @Override
    public boolean modifyEnterpriseAttention(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.updateEnterpriseAttention(userJobEnterprise)!=0;
    }

    @Override
    public boolean addUIdEidJid(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.insertUIdEidJid(userJobEnterprise) == 1;
    }

    @Override
    public boolean modifyEnterpriseStatus(UserJobEnterprise userJobEnterprise) {
        return userJobEnterpriseDao.updateEnterpriseStatus(userJobEnterprise)==1?true:false;

    }

    @Override
    public int getCountNum(Map<String,String> map) {
        return userJobEnterpriseDao.querycount(map);
    }

    @Override
    public List<UserJobEnterpriseDao> queryJobAll(Map<String,String> map) {
        return userJobEnterpriseDao.selectJobAll(map);
    }

}